package com.clp.util.hutool.core.bean;

import com.clp.util.hutool.core.lang.SimpleCache;
import com.clp.util.hutool.core.lang.func.Func0;

/**
 * Bean属性缓存<br>
 * 缓存用于防止多次反射造成的性能问题
 * @author Looly
 *
 */
public enum BeanDescCache {

    INSTANCE;

    private final SimpleCache<Class<?>, BeanDesc> bdCache = new SimpleCache<>();

    public BeanDesc getBeanDesc(Class<?> beanClass, Func0<BeanDesc> supplier) {
        return bdCache.get(beanClass, supplier);
    }

}
